<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    let arr = []
    let flag = 0

    for (let i = 0; i < 5; i++) {
        arr.push(new Promise((resolve) => {
            flag++
            resolve("promise" + i)
        }))
    }

    console.log(arr)
    console.log(flag)
    console.log(Promise.all(arr))
    console.log(flag)
</script>
</body>
</html>
